package fields;

import translate.Translate;
import entities.Inventory;
import gstd.Player;

public class LaborCamp extends Ownable {

	private int baseRent;

	public LaborCamp(String name, int baseRent, int price) {
		super(name, price);

		this.baseRent = baseRent;
	}

	@Override
	public int getRent() {
		return baseRent;
	}

	@Override
	public void landOnField(Player player) {
		buyField(player);
		if (getOwner() != null && getOwner() != player) {
			int rent = getRent()
					* player.getDiceSum();

			player.getInventory().addBalance(-rent);
			getOwner().getInventory().addBalance(rent);
		}
	}
	
	@Override
	public String toString() {
		return super.toString() + Translate.print("Rent: %d times the rolled dices", baseRent);
	}
}
